cmake_minimum_required(VERSION 3.0.2)
project(controller)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)

find_package(Eigen3 REQUIRED)

find_package(catkin REQUIRED COMPONENTS
  quad_msgs
  roscpp
  rosbag
  transform_utils
  trajectory_msgs
  dji_osdk_ros
)

catkin_package()

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
  ${EIGEN3_INCLUDE_DIRS}
)

add_library(dji_controller src/dji_controller.cpp)
target_link_libraries(dji_controller
  ${catkin_LIBRARIES}
)

add_executable(dji_controller_node src/dji_controller_node.cpp)
target_link_libraries(dji_controller_node
  ${catkin_LIBRARIES}
  dji_controller
)

# 测试例程
add_executable(calib_force test/calib_force.cpp)
target_link_libraries(calib_force
  ${catkin_LIBRARIES}
)

add_executable(calc_orien test/calc_orien.cpp)
target_link_libraries(calc_orien
  ${catkin_LIBRARIES}
)

add_executable(simple_test test/simple_test.cpp)
target_link_libraries(simple_test
  ${catkin_LIBRARIES}
)